<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
//后台路由
Route::group(['namespace' => 'Admin'], function () {
    // 登录
    Route::get('login', 'LoginController@login');
    Route::post('login', 'LoginController@signIn');
    Route::get('captcha/{rcode?}', 'LoginController@captcha');
    Route::post('sendms', 'LoginController@sendms');
    Route::get('logout', 'LoginController@logOut');
    Route::get('test', 'TestController@test');

    Route::group(['middleware' => 'auth:admin'], function(){
        // 首页
        Route::get('/', 'IndexController@index');
        Route::get('index', 'IndexController@index');
        Route::get('menu', 'IndexController@getMenu');
        Route::get('forbidden', 'IndexController@forbidden');
        Route::get('main', 'IndexController@main');

        Route::group(['middleware' => 'rbac'], function(){
            // 用户管理
            Route::get('users', 'UserController@users');

            Route::get('admins', 'RuleController@admins');
            Route::get('addadmin', 'RuleController@addAdmin');
            Route::post('addadmin', 'RuleController@addAdmin');
            Route::get('editadmin/{id}', 'RuleController@editAdmin');
            Route::post('editadmin', 'RuleController@editAdmin');
            Route::post('activeAdmin', 'RuleController@activeAdmin');

            // 权限管理
            Route::get('addRule', 'RuleController@addRule');
            Route::post('addRule', 'RuleController@addRule');
            Route::get('editRule/{id}', 'RuleController@editRule');
            Route::post('editRule', 'RuleController@editRule');
            Route::post('deleteRule', 'RuleController@deleteRule');
            Route::get('rules', 'RuleController@rules');
            Route::post('editCheckRule', 'RuleController@editCheckRule');
            Route::post('editShowRule', 'RuleController@editShowRule');
            Route::post('editSortRule', 'RuleController@editSortRule');
            // 角色管理
            Route::get('addRole', 'RuleController@addRole');
            Route::post('addRole', 'RuleController@addRole');
            Route::get('editRole/{id}', 'RuleController@editRole');
            Route::post('editRole', 'RuleController@editRole');
            Route::post('deleteRole', 'RuleController@deleteRole');
            Route::get('roles', 'RuleController@roles');
            // 权限配置
            Route::get('setRules/{role_id}', 'RuleController@setRules');
            Route::post('setRules', 'RuleController@storeRules');
            //会员财务报表
            Route::get('moneyReport','MoneyReportController@index');
            Route::get('moneyReportDelete','MoneyReportController@destory');
            //会员信息列表
            Route::get('userList','UserListController@index');
            //所有用户的提现记录
            Route::get('userCashList','CashRecordController@index');
            Route::get('userCashPass','CashRecordController@updateStatus');
            //用户开卡列表（线下）
            Route::get('actVerf','AccountVerfController@index');
            //用户开卡的审核(线下)
            Route::get('actVerfEdit','AccountVerfController@updateStatus');
            //后台人工修改用户的密码
            Route::get('changePsw','UserController@changePsw');
            //后台删除前台用户
            Route::get('delUser','Usercontroller@deleteUser');
            //后台对复投的资格审核
            Route::group(['prefix' => 'repeat'], function () {
                Route::get('index', 'ReportController@index');
                Route::get('verifyStatus', 'ReportController@verifyStatus');
            });

            //订单管理
            Route::group(['prefix'=>'order'],function(){
                Route::get('index','OrderController@index')->name('OrderIndex');
                Route::post('changestatus','OrderController@ChangeStatus')->name('ChangeStatus');
                Route::get('getstatus','OrderController@GetStatus')->name('GetStatus');
                Route::get('getorderdetail','OrderController@GetOrderDetail')->name('GetOrderDetail');


            });

            Route::group(['prefix'=>'goods'],function(){
                Route::get('index','GoodsController@index')->name('AdminGoodsIndex');
                Route::get('changestatus','GoodsController@ChangeStatus')->name('AdminGoodsChangeStatus');
                Route::get('details','GoodsController@Details')->name('Details');
                Route::get('delgoods','GoodsController@DelGoods')->name('DelGoods');
                Route::get('create', 'GoodsController@create');
                Route::post('qiniu_token', 'GoodsController@getQiniuToken');
                Route::post('store', 'GoodsController@store');
                Route::get('edit', 'GoodsController@edit');
                Route::put('update', 'GoodsController@update');
            });
        });

        Route::get('gettest','testController@test')->name('gettest');

    });

});
